package com.youga.xuapplication.app;

import android.app.Application;

import com.youga.xuapplication.model.User;
import com.youga.xuapplication.util.SpUtil;

import cn.jpush.android.api.JPushInterface;

/**
 * Created by Youga on 2016/1/16.
 */
public class XuApplication extends Application {


    private User user;

    public static XuApplication application;

    @Override
    public void onCreate() {
        super.onCreate();
        application = this;
        JPushInterface.init(this);
    }

    public void setUser(User user) {
        this.user = user;
    }

    public User getUser() {
        return user == null ? (User) SpUtil.getEntityPreferences(this, User.class) : user;
    }
}
